package servlet;

import dbtools.GlobalParam;
import dbtools.PropertiesUtil;
import server.Control;
import server.Service;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


public class initDataScan extends HttpServlet {
	private static final long serialVersionUID = 2960665641425153638L;
	@Override
	protected void doGet(final HttpServletRequest request,
			final HttpServletResponse response) throws ServletException,
			IOException {
	}
	@Override
	protected void doPost(final HttpServletRequest request,
			final HttpServletResponse response) throws ServletException,
			IOException {
	}
	@Override
	public void init() throws ServletException {
		    PropertiesUtil dbProps = new PropertiesUtil("dbconfig.properties");
			System.out.println("开始了:"+dbProps.readProperty("jdbc.driver"));
			GlobalParam.driver=dbProps.readProperty("jdbc.driver");
			GlobalParam.username=dbProps.readProperty("jdbc.username");
			GlobalParam.password=dbProps.readProperty("jdbc.password");
			GlobalParam.url=dbProps.readProperty("jdbc.url");
		    GlobalParam.urlx=dbProps.readProperty("jdbc.urlx");
			GlobalParam.maxactive=dbProps.readProperty("dbcp.maxActive");
			Control coreBusinessConntrol = new Control();
			Service.control = coreBusinessConntrol;
			coreBusinessConntrol.doStartServer();


    }


 
}
